//
//  ActionScrollView.m
//  AppsTemplate
//
//  Created by Maple on 16/8/18.
//  Copyright © 2016年 Maple. All rights reserved.
//

#import "ActionScrollView.h"

@implementation ActionScrollView

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
    
    if ([self panBack:gestureRecognizer]) {
        return YES;
    }
    return NO;
    
}


- (BOOL)panBack:(UIGestureRecognizer *)gestureRecognizer {
    
    if (gestureRecognizer == self.panGestureRecognizer) {
        UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)gestureRecognizer;
        CGPoint point = [pan translationInView:self];
        UIGestureRecognizerState state = gestureRecognizer.state;
        CGPoint location = [gestureRecognizer locationInView:self];
        if (point.x > 0 && self.contentOffset.x <= 0) {
            return YES;
        }
    }
    return NO;
    
}

@end
